package org.dubnation.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.dubnation.base.domain.BaseDomain;


import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author zhu
 * @since 2023-10-27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@NotNull
public class Shop extends BaseDomain{

    private static final long serialVersionUID = 1L;
    /** 待审核 **/
    public static final Integer AUDIT = 1;
    /** 审核通过待激活 **/
    public static final Integer TO_BE_ACTIVATED = 2;
    /** 激活成功 **/
    public static final Integer ACTIVATED = 3;
    /** 驳回 **/
    public static final Integer REJECT = 4;

    //JSR303校验--后端校验参数是否为空的方法，适用于大规模对象字段校验
    private Long id;
    @NotBlank(message = "商店名字不能为空")
    private String name;
    @NotBlank(message = "商店座机不能为空")
    private String tel;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date registerTime;
    /**
     * 1=待审核 2=审核通过待激活 3=激活成功 4=驳回
     */
    private Integer state;
    @NotBlank(message = "商店地址不能为空")
    private String address;
    @NotBlank(message = "商店logo不能为空")
//    @URL(message = "店铺logo必须是一个合法的url")
    private String logo;
    /**
     * 商店管理员
     */
    @NotNull(message = "商店管理员不能为空")
    private Employee admin;
    /**
     * 经度
     */
    private Double lng;
    /**
     * 纬度
     */
    private Double lat;
    /**
     * 驳回次数
     */
    private Integer rejectedNum;
}
